package repository

import (
	"context"
	"xs.jsjb/internal/app/menu/entity"
)

func (m *menuRepo) GetMenu(ctx context.Context, title string) (menu *entity.GetMenuRes, err error) {
	menu = new(entity.GetMenuRes)
	if err = m.db.WithContext(ctx).Table("menu").Where("title = ?", title).First(menu).Error; err != nil {
		return
	}
	return
}
